<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String username = user.getName();
	String siteid = user.getSiteId();
	String defaultSiteId = request.getAttribute("defaultSiteid")+"";
%>

<div>
	<form target="_coreIframe" method="post" action="<%=request.getContextPath()%>/check/doAddData" enctype="multipart/form-data">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>上传考勤数据</li>
			</ul>
		</div>
		<table class="formTable">
			<tr>
				<td class="tdTitle">所属公司：</td>
				<td>
					<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					<span class="errorTipWrap" id="errorTip_siteid"></span>
				</td>
			</tr>	
			<tr>
				<td class="tdTitle">考勤机型号：</td>
				<td>
					<select id="deviceList" class="easyui-combobox" name="device" style="width:100px;"></select>
					<span class="errorTipWrap" id="errorTip_device"></span>
				</td>
			</tr>					
			<tr>
				<td class="tdTitle">考勤数据：</td>
				<td>
					<input class="inputText xs" type="file" name="data">
				</td>
			</tr>
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.NAV.navTo('/check')">取消</a>
					</div>
				</td>
			</tr>	
		</table>
		<input type="hidden" value="<%=username %>" name="adduser"> 
		<input type="hidden" value="<%=siteid %>" name="entersite"> 	
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
});
$('#deviceList').combobox({
	url:global.contextPath + '/company/deviceList',
	valueField:'id',
	textField:'text',
});
$('#siteList').combobox('setValue', '<%=defaultSiteId %>');
</script>


